const Mock = require('mockjs');
import allDays from './test';

Mock.mock('http://localhost:3000/main/dashboard', 'get', () => {
    const allMoney = Array.from({ length: 30 }, () => Mock.Random.float(1000, 3500).toFixed(2));
    const allOrders = Array.from({ length: 30 }, () => Mock.Random.integer(1000, 3500))
    return {
        code: 200,
        message: '操作成功',
        data: {
            realtimeData: {
                order: [

                    {
                        category: 'pendingPayment',
                        title: '待付款',
                        count: 639,
                    },
                    {
                        category: 'toBeShipped',
                        title: '待发货',

                        count: 320,
                    },
                    {
                        category: 'pendingAftersalesService',
                        title: '售后待服务',
                        count: 178,
                    },
                    {
                        category: 'toBeEvaluated',
                        title: '待评价',
                        count: 245,
                    },
                    {
                        category: 'pendingComplaints',
                        title: '待投诉',
                        count: 8,
                    },
                    {
                        category: 'illegalProducts',
                        title: '违规产品',
                        count: 13,
                    },
                    {
                        category: 'totalOrders',
                        title: '总订单',
                        count: 894,
                    },
                    {
                        category: 'salesAmount',
                        title: '销售额',
                        count: 2434.23,
                    }
                ],
                'allMoney|30': [{
                    'value|2000-2500': 1
                }],
                allMoney,
                allDays,
                allOrders: allOrders,
            },

            userData: {
                icon: '/images/头像.png',
                username: '用户名',
                level: '金牌店铺',
                levelImg: '/images/金牌.svg',
                moeny: 3843.23,
                freezeMoney: 234.23,
                promiseMoney: 500,
                desc: '4.9',
                service: '4.9',
                logistics: '4.9',
            },

            shopData: {
                level: 3,
                paymentConversionRate: {
                    value: 0.1511,
                    contrast: 0.0223,
                },
                visitorCount: {
                    value: 4589,
                    contrast: 0.0577,
                },
                numberOfPaymentSubOrders: {
                    value: 463,
                    contrast: 0.0456,
                },
                viewVolume: {
                    value: 2455,
                    contrast: 0.0356,
                },
                realTimeVisitors: {
                    time: '15:00',
                    addr: '山东大学中心',
                },
                mobileVisitorVolume: 234,
                productRanking: '小份黄焖鸡米饭',
                competitiveDynamics: '得力发布了231张优惠卷',
            },
        }

    }
});

